import { functionCommon, requestCommon } from "@whzhuke/common"

export default {
  list: (params: any) => {
    return requestCommon.get<any>({
      url: `${functionCommon.requestHost("api")}/v1/m/goods`,
      params
    })
  },
  item: (params: any) => {
    return requestCommon.get<any>({
      url: `${functionCommon.requestHost("api")}/v1/m/goods/${params.id}`
    })
  },
  add: (params: any) => {
    return requestCommon.postJson<any>({
      url: `${functionCommon.requestHost("api")}/v1/m/goods`,
      params
    })
  },
  del: (params: any) => {
    return requestCommon.del<any>({
      url: `${functionCommon.requestHost("api")}/v1/m/goods/${params.id}`,
      params
    })
  },
  edit: (params: any) => {
    return requestCommon.put<any>({
      url: `${functionCommon.requestHost("api")}/v1/m/goods`,
      params
    })
  }
}
